﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin_MasterPage.master" AutoEventWireup="true" CodeFile="DanhSachSanPham.aspx.cs" Inherits="Admin_DanhSachSanPham" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    function checkAll(obj) {
        var checkList = document.getElementsByTagName("input");
        for (var i = 0; i < checkList.length; i++) {
            if (checkList[i].type == 'checkbox' &&
	        checkList[i].id.indexOf("cb_Delete") >= 0) {
                checkList[i].checked = obj.checked;
            }
        }
    }
</script>
<div id="alldanhsachsanpham">   
            <span class="TieuDe">Danh sách Sản phẩm</span><br />
            
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
     <Triggers>
     <asp:AsyncPostBackTrigger ControlID="pager" EventName="Command" />
     <asp:AsyncPostBackTrigger ControlID="btn_timkiem" EventName="Click" />
     <asp:AsyncPostBackTrigger ControlID="btn_Xoa" EventName="Click" />
     </Triggers>
        <ContentTemplate>
        <div class="clear"></div>
            <div id="timkiem" style="border-bottom-style:solid; border-bottom-width:thin; background-color:#f3f3f3; color:#8B4513; font-weight:bold; margin-top:10px;">
                    Tên sản phẩm:&nbsp;<asp:TextBox ID="txt_tensanpham" runat="server"></asp:TextBox> &nbsp;
                    Tên loại sản phẩm:&nbsp;<asp:DropDownList ID="ddl_tenloaisanpham" runat="server">
                            </asp:DropDownList>&nbsp;
                    Tên nhà sản xuất:&nbsp;<asp:DropDownList ID="ddl_nhasanxuat" runat="server">
                            </asp:DropDownList>&nbsp;
                    <asp:Button CssClass="button" ID="btn_timkiem" runat="server" Text="Tìm Kiếm" 
                        onclick="btn_timkiem_Click" />

                        <asp:HyperLink CssClass="button" ID="btn_Themnsx" NavigateUrl="~/Admin/ThemSanPham.aspx" runat="server">Thêm sản phẩm</asp:HyperLink>
                </div>
            <asp:Repeater ID="rpt_SanPham" runat="server" 
                onitemdatabound="rpt_SanPham_ItemDataBound" onitemcommand="rpt_SanPham_ItemCommand" >
            
                <HeaderTemplate>       
                <table border="1px" style="width:100%" width="100%">
                <tr class="TieuDeTable" style="border-bottom-style:solid; border-bottom-width:medium; text-align:center; background-color:#f3f3f3;">
                    <td>STT</td>
                    <td><asp:LinkButton CssClass="TableTitle" ID="lbtn_TenSanPham" 
                                    CommandArgument="TenSP" runat="server">Tên sản phẩm</asp:LinkButton>
                    </td>
                    <td>Loại</td>
                    <td>CPU</td>
                    <td>RAM</td>
                    <td>HDD</td>
                    <td>Card Màn hình</td>
                    <td>CD/DVD</td>
                    <td>Giá</td>
                    <td>Nhà sản xuất</td> 
                    <td>Cập nhật</td>
                    <td><input id="chb_CheckAll" onclick="checkAll(this);" type="checkbox" />Xóa</td>
                </tr>
                </HeaderTemplate>
                <ItemTemplate>

                <tr style="color:Black;">
                    
                            <td><asp:Label ID="lb_STT" runat="server"></asp:Label></td>
                            <td><%#Eval("TenSanPham") %></td>
                            <td><asp:Label ID="lb_Tenloai" runat="server" /></td> 
                            <td><%#Eval("CPU") %></td>
                            <td><%#Eval("RAM") %></td>
                            <td><%#Eval("HDD") %></td>
                            <td><%#Eval("CardManHinh") %></td>
                            <td><%#Eval("CD_DVD") %></td>
                            <td><asp:Literal ID="lit_Gia" runat="server"></asp:Literal></td>
                            <td><asp:Label ID="lb_nhasx" runat="server"></asp:Label></td>
                            <td> <asp:HyperLink ID="hl_Update" Text="Cập nhật" runat="server" /></td>
                            <td>
                                <asp:CheckBox ID="cb_Delete" runat="server" />
                                <asp:HiddenField ID="hf_ID" runat="server" />
                            </td>
                </tr>                
                </ItemTemplate>
                <FooterTemplate>
                       </table>
                </FooterTemplate>
            </asp:Repeater>
            <div id="pager1">
                   
                    <!--BEGIN: phan trang-->
                                
            <cc1:PagerV2_8 ID="pager" runat="server" GeneratePagerInfoSection="False"  
                FirstClause="First" Font-Underline="False"
                                     NextClause="Next" PreviousClause="Previous" 
                oncommand="pager_Command" ForeColor="#33CC33" Width="200"/>
                
       </div>
       <!--END: phan trang--> 
                    
                    <!-- End .pagination -->
                    <div class="align-right">
                    <asp:Button CssClass="button" ID="btn_Xoa" runat="server" Text="Xóa" 
                            onclick="btn_Xoa_Click" />

                            </div>
            
                            
          <div class="clear"></div>
          </ContentTemplate>
     </asp:UpdatePanel>
    </div> <!--End alldanhsachsanpham-->
</asp:Content>
